-- CALC_RELIC_BONUS_AMOUNT

-- 遗迹可掠夺量(额外)
return function(targetInfo)
    -- 先获取玩家飞艇属性
    local airshipInfo = NewAirShipM.getUserAirShipInfo(NewAirShipM.getActiveAirShip());

    local sourceLuck = airshipInfo["luck"];

    -- 天赋影响掠夺幸运加成
    local prop = PropM.combine(ME.user, "rob_attrib", "luck");
    sourceLuck = PropM.apply(prop, sourceLuck);

    -- 对方的幸运要加上被动秘宝计算
    local targetLuck = targetInfo.luck;
    targetLuck = SkyShipSkillM.calcPassiveAttrib("luck",
            targetLuck, targetInfo["ship_skills"]);

    -- 天赋影响守卫幸运加成
    if targetInfo["guard_luck"] then
        targetLuck = targetLuck + targetInfo["guard_luck"];
    end

    -- 天空战附加属性
    targetLuck = targetLuck + SkyPropM.calcAddonByData(targetInfo, "luck", targetLuck);

    -- 只有幸运高于对方才能夺取
    if sourceLuck <= targetLuck then
        return 0;
    end

    local rate = math.modf((200 * sourceLuck - 80 * targetLuck) / (sourceLuck + 4 * targetLuck + 20));

    -- 钛合金储藏室等级
    --local funcId     = SkyRelicFunctionM.getIdsByRule("metal_store");
    --local storeLevel = SkyRelicFunctionM.getLevel(funcId);

    -- 额外获取量
    local total = math.min(targetInfo["store_resource"] or 0, 500000);
    return math.modf(total * rate / 1000);
end
